package goods;

import java.util.ArrayList;
import java.util.List;

public class Goods {
	private String id;
	/*商品名称*/
	private String goodsName;
	/*商品单价*/
	private double price;
	/*商品数量*/
	private Integer num;

	private double subtotal;

	public double getSubtotal() {
		return this.subtotal = this.price * this.num;
	}

	public Goods() {
		super();
	}

	public Goods(String goodsName, double price) {
		super();
		this.goodsName = goodsName;
		this.price = price;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getGoodsName() {
		return goodsName;
	}
	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	public Integer getNum() {
		return num;
	}
	public void setNum(Integer num) {
		this.num = num;
	}

	@Override
	public String toString() {
		return "Goods{" +
				", goodsName='" + goodsName + '\'' +
				", price=" + price +
				", num=" + num +
				'}';
	}
}
